package com.sdp.core.bizc.exception;

import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sdp.core.bizc.vo.Result;

@ControllerAdvice
public class ApplicationExceptionHandler {
	
	 @ResponseBody
	 @ExceptionHandler(ApplicationException.class)
	public Result<?> applicationExceptionHandler(HttpServletResponse response,Exception ex){
		 ex.printStackTrace();
		 return Result.error(ex.getMessage());
	}
}
